package string;

public class MatchesDemo {
    public static void main(String[] args) {
        String email = "wuyu@163.cn";
        String regex = "\\w+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match = email.matches(regex);
        if (match) {
            System.out.println("匹配成功");
        }else{
            System.out.println("匹配失败");
        }
    }
}
